model.5.i.p <- plm(inclprop~past.conference.number.noIR + incidence_flag + mad_gdppc + p_polity2 + gwf_personal + gwf_party + gwf_military+first.leader+leader.size+leader.time.in.office+leader.historical.count+ coastdist+brit_coastdist, data=epr.final[is.na(epr.final$inclprop)==FALSE,],index=c("countries_gwid","year"),model="within",effect="twoways")
summary(model.5.i.p) 

model.5.i.pop <- plm(legippop~past.conference.number.noIR + incidence_flag + mad_gdppc + p_polity2 + gwf_personal + gwf_party + gwf_military+first.leader+leader.size+leader.time.in.office+leader.historical.count+ coastdist + brit_coastdist, data=epr.final[is.na(epr.final$inclprop)==FALSE,],index=c("countries_gwid","year"),model="within",effect="twoways")
summary(model.5.i.pop) 


coef.Names.2 <- c("Conference Count","Civil War","GDP per capita","Polity","Personalist Regime","Party Regime","Military Regime","First Leader","Leader Group Size","Leader Time in Office","Leader Count","ln Distance to Coast of leader group","ln Distance to Coast of leader group times British Colony")
model.Names.2 <- c("Proportion incl. groups","Proportion incl. pop")

print(
texreg(list(model.5.i.p,model.5.i.pop),use.packages=FALSE,dcolumn=TRUE,custom.coef.names=coef.Names.2,custom.model.names=model.Names.2,stars = c(0.01, 0.05, 0.1),digits=3,scalebox=0.7,caption="Linear fixed effects models. Outcome variables: Proportion of excluded and included groups/population. Unit of analysis is the country-year. All models include year and country fixed effects",label="table:mainTable:3",caption.above=TRUE)
)
